package com.episode.duetapi.exceptionHandle;

import org.apache.shiro.authc.AuthenticationException;

import com.episode.duetapi.utils.ResultCode;

public class CustomerException extends AuthenticationException{
	
	private ResultCode resultCode;
	
	private int code;
	
	private String msg;

	public CustomerException(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public CustomerException(ResultCode resultCode) {
		this.resultCode = resultCode;
	}

	public ResultCode getResultCode() {
		return resultCode;
	}

	public void setResultCode(ResultCode resultCode) {
		this.resultCode = resultCode;
	}

	public int getCode() {
		if(null != resultCode) {
			return resultCode.getCode();
		}
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		if(null != resultCode) {
			return resultCode.getMsg();
		}
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

}
